/***************************************************************************
 创建者: 华磊
 开始时间: 2019.7.10
 copyright: (C) 深圳市华友高科有限公司
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2020.5.8 类的具体实现代码编写

 ***************************************************************************
 *  @file x.h
 *  功能: 反光条相关编辑功能
 *
 *                                                                         *
 ***************************************************************************/
#ifndef REFLECTEDITDIALOG_H
#define REFLECTEDITDIALOG_H

#include <QDialog>
#include <QStandardItemModel>
#include <QTimer>
#include "mapdelegate.h"

namespace Ui {
class ReflectEditDialog;
}

class MapScene;


class ReflectEditDialog : public QDialog
{
    Q_OBJECT

public:
    explicit ReflectEditDialog(MapDelegate *mapDelegateIn,MapScene *sceneIn,QWidget *parent = 0);
    ~ReflectEditDialog();
    int showDialog();
    int hideDialog();
    void getAllReflectMarks();

public slots:
    void useUserPoint_slot(double x,double y,double r);

private slots:
    void showChooseLaserPoint_slot();
    void timeroutslot();
    void on_pushButton_getAllReflectMarks_clicked();

    void on_pushButton_saveAllReflectMarksToFile_clicked();

    void on_pushButton_deleteSelectedMark_clicked();

    void on_pushButton_addReferenceMark_clicked();

//    void on_pushButton_copyMapPoint_clicked();

//    void on_pushButton_copyLaserPoint_clicked();

    void on_checkBox_isShowAllReflectMarks_clicked(bool checked);

    void on_checkBox_isShowCalculatedReflectPoint_clicked(bool checked);

    void on_checkBox_isShowDetectedLaserPoint_clicked(bool checked);

private:
    void updateReferencePointShow();
    int displayReflectDebugInfo(ReflectDebugInfo &infoIn);
    int displayReflectLaserPointInfo(std::vector<struct LaserMarkInfo> laserMarks);
    int displayAllReflectMarks(std::vector<ReflectMarkInfo> &reflectMarksIn);
signals:
    void displayAllReflectMarksInMap_signal(bool isDisplay);

private:
    Ui::ReflectEditDialog *ui;
    MapDelegate *mapDelegate;
    QStandardItemModel* model_reflectDebugInfo;
    QVector<QStandardItem*> itemList_reflectDebugInfo;

    QStandardItemModel* model_reflectLaserPointInfo;
//    QVector<QStandardItem*> itemList_reflectLaserPointInfo;

    QStandardItemModel* model_allReflectMarksInfo;
//    QVector<QStandardItem*> itemList_allReflectMarksInfo;

    QTimer *timer;
    std::vector<ReflectMarkInfo> allReflectMarks;
    ReflectDebugInfo matchDebugInfoOut;
    MapScene *scene;
};

#endif // REFLECTEDITDIALOG_H
